<script>
import { useCounterStore } from "../stores/counter"
// 在组件中使用pinia中定义的属性或方法
const countStore = useCounterStore()
export default {
    data() {
        return {
            arr: [
                {
                    id: 1,
                    img: "/images/3.jpg",
                }
            ],
        }
    },

    methods: {
        updateCollapse(){
            countStore.updateCollapse()
        }
    },
}
</script>

<template>
    <el-header class="top-bar">
        <div class="left-content">
            <el-button size="large" round @click="updateCollapse" >
                <i class="ri-menu-line"></i>
            </el-button>
        </div>

        <div> <span class="title">南京市古树名木管理系统</span> </div>

        <div class="right-content">
            <el-dropdown>
                <span class="el-dropdown-link">
                    <!-- {{ arr[0].img }} -->
                    <img class="user" :src="arr[0].img" alt="">
                </span>

                <template #dropdown>
                    <el-dropdown-menu>
                        <el-dropdown-item>个人中心</el-dropdown-item>
                        <el-dropdown-item>退出</el-dropdown-item>
                    </el-dropdown-menu>
                </template>

            </el-dropdown>
        </div>
    </el-header>
</template>

<style scoped>
.top-bar{
    height: 60px;
    display: flex;
    /* justify-content: space-between; */
    background: black;
    align-items: center;
}

.right-content{
    position: absolute;
    right: 15px;
}
.user {
    width: 40px;
    border-radius: 50%;
}

el-button {
    height: 100px;
}

div .title {
    color: #fff;
    font-size: 25px;
    left: 50px;
    position: relative;
}

.el-dropdown-link {
    padding-bottom: 0;
}
</style>